package im.oen.gui.tools.config;

/**
 * @author Kevin.Xu
 */

import im.oen.gui.tools.util.MsgUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.i18n.LocaleContextHolder;

import javax.annotation.PostConstruct;
import java.util.Locale;

/**
 * 配置国际化语言
 *
 * @author Kevin.Xu
 */
@Configuration
public class LocaleConfig {

    @Autowired
    private MessageSource messageSource;

    @PostConstruct
    private void init() {
        LocaleContextHolder.setDefaultLocale(Locale.CHINA);
        MsgUtil.init(messageSource);
    }
}
